<?php
/**
 * Created by PhpStorm.
 * User: WormW
 * Date: 2017/7/17 0017
 * Time: 9:05
 */

namespace app\common\validate;

use think\Validate;

class User extends Validate
{
    protected $rule=[
        'username'=>'require|unique:user,name|max:25',
        'real-name'=>'require|chs|max:15',
        'id-number'=>'require|number|length:18',
//        'password'=>'require|between:6,18',
//        'repassword'=>'require|confirm:password',
        'company_name'=>'require',
        'company_number'=>'require',
//        'captcha|验证码'=>'require|captcha'
    ];
    protected $message=[
        'username'=>'名字有误',
        'real-name'=>'请填写正确的中文名',
        'id-number'=>'请填写正确的身份证号码',
//        'password'=>'密码长度有误',
//        'repassword'=>'两次密码不一致',
        'company_name'=>'必须填写企业名',
        'company_number'=>'必须填写企业编号',
//        'captcha|验证码'=>'验证码错误'
    ];
    protected $scene=[
      'sign-up'=>['username','real-name','id-number','company_name','company_number'],
        'edit'=>['username','real-name','id-number','company_name','company_number'],
        'login'=>['username','password'],
        ];
}